﻿using Elev.MoviesCenter.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Elev.MoviesCenter.Controls
{
    /// <summary>
    /// UC_MoviesView.xaml 的交互逻辑
    /// </summary>
    public partial class UC_MoviesView : UserControl
    {
        public UC_MoviesView()
        {
            InitializeComponent();
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            var files = LocalCenter.DBEntities.TB_FilesInfo.ToList();
            foreach (var movie in files)
            {
                //TODO:根据名称查找电影详情并传进去
                UC_MovieCard movieCard = new UC_MovieCard(movie);
                movieCard.Width = 200;
                movieCard.Height = 300;
                movieCard.Margin = new Thickness(2);
                movieCard.Background = Brushes.Yellow;
                wrpMain.Children.Add(movieCard);
            }
        }
    }
}
